﻿namespace Infrastructure.Model
{
    /// <summary>
    ///   指定 Attribute 的使用目标为类
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = false)]
    public class AppServiceAttribute : System.Attribute
    {
        // 构造函数
        public AppServiceAttribute()
        {
            // 设置默认的服务生命周期为 Scoped
            ServiceLifetime = LifeTime.Scoped;
        }

        // 属性：指定服务的生命周期，默认为 Scoped
        public LifeTime ServiceLifetime { get; set; } = LifeTime.Scoped;

        // 属性：指定服务的类型
        public Type ServiceType { get; set; }

        // 属性：标识是否为接口服务类型
        public bool InterfaceServiceType { get; set; }
    }
}
